import java.util.Scanner;

public class Text {
    public static void main(String[] args) {
        userManager s = new userManager();
        PubManager press = new PubManager();
        Scanner scanner = new Scanner(System.in);
        BookManager book = new BookManager();
        for (; ; ) {
            s.Login();
            for (; ; ) {
                System.out.println("请输入数字进行选择：1.图书管理  2.出版社管理  3.退出登入  4.退出系统");
                int x = scanner.nextInt();
                if (x == 1) {
                    System.out.println("请输入：1.增加  2.删除  3.更新  4.查询  5.返回上一级菜单");
                    int i = scanner.nextInt();
                    if (i == 1) {
                        book.add();
                        continue;
                    }
                    if (i == 2) {
                        book.delect();
                        continue;
                    }
                    if (i == 3) {
                        book.update();
                        continue;
                    }
                    if (i == 4) {
                        book.select();
                        continue;
                    }
                    if (i == 5) {
                        continue;
                    }
                }
                if (x == 2) {
                    System.out.println("请输入：1.增加 2.删除 3.更新 4.根据出版社名称查询 5.查询所有出版社 6.返回上一级菜单");
                    int o = scanner.nextInt();
                    if (o == 1) {
                        press.add();
                        continue;
                    }
                    if (o == 2) {
                        press.delect();
                        continue;
                    }
                    if (o == 3) {
                        press.update();
                        continue;
                    }
                    if (o == 4) {
                        press.select();
                        continue;
                    }
                    if (o == 5) {
                        press.allselect();
                        continue;
                    }
                    if (o == 6) {
                        continue;
                    }
                }
                if (x == 3) {
                    break;
                }
                if (x == 4) {
                    System.exit(1);
                }
            }
        }
    }
}